/*
Added by Sulan DCDM++ svn73
*/
#if !defined(AFX_DetectorPageDlg_H__A7EB85C3_1EEA_4FEC_8450_C090219B8619__INCLUDED_)
#define AFX_DetectorPageDlg_H__A7EB85C3_1EEA_4FEC_8450_C090219B8619__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define ATTACH(id, var) var.Attach(GetDlgItem(id))
#include "../client/SettingsManager.h"
#include "../client/ClientProfileManager.h"
class DetectorPageDlg : public CDialogImpl<DetectorPageDlg>
{
	
	CComboBox ctrlRaw;

public:
	int raw;
	tstring text;
	bool display;

	enum { IDD = IDD_DETECTOR_DLG };

	BEGIN_MSG_MAP(DetectorPageDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
		COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
		COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
	END_MSG_MAP()

	DetectorPageDlg() { };


	LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
		ctrlRaw.SetFocus();
		return FALSE;
	}

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
	{

		ATTACH(IDC_ITEM_RAW, ctrlRaw);
		//Sulan start svn209
		for(int n=0;n<11;){
			ctrlRaw.AddString(RAWSETTING(n).c_str());
			++n;
		}
		//End
		ctrlRaw.SetCurSel(raw);

		SetDlgItemText(IDC_TEXT, text.c_str());
		SetWindowText(text.c_str());
		::CheckDlgButton(*this, IDC_DISPLAY_CHEAT, display ? BST_CHECKED : BST_UNCHECKED);
		CenterWindow(GetParent());
		return FALSE;
	}

	LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	{
		if(wID == IDOK) {
			raw = ctrlRaw.GetCurSel();
			CButton btn = ::GetDlgItem(m_hWnd, IDC_DISPLAY_CHEAT);
			display = Util::toBool(btn.GetCheck());
		}
		EndDialog(wID);
		return 0;
	}
};

#endif // !defined(AFX_FDetectorPageDlg_H__A7EB85C3_1EEA_4FEC_8450_C090219B8619__INCLUDED_)